import { defHttp } from "@/utils/http";
import { baseUrlApi } from "./utils";

/** 执行记录 */
export const getMrpTaskPageList = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/mrp/task/pagelist"),
    data
  });
};

/** 启用 */
export const getMrpTaskEnable = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/mrp/task/enable"),
    data
  });
};

/** 查看计划任务详情 */
export const getMrpTaskDetail = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/mrp/task/detail"),
    data
  });
};

/** 计划执行结果 */
export const getMrpResultPageList = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/mrp/result/pagelist"),
    data
  });
};

/** 重新执行 */
export const getMrpReExecute = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/mrp/reExecute"),
    data
  });
};

/** MRP计划列表带分页 */
export const getMrpPageList = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/mrp/pagelist"),
    data
  });
};

/** MRP计划详情 */
export const getMrpDetail = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/mrp/detail"),
    data
  });
};

/** 关闭 */
export const getMrpClose = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/mrp/close"),
    data
  });
};

/** 新增MRP计划 */
export const getMrpAdd = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/mrp/add"),
    data
  });
};

/** 获取可选交付批次 */
export const getMrpDeliverBatchList = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/mrp/deliverBatch/list"),
    data
  });
};

/** 获取交付批次详情 */
export const getMrpDeliverBatchDetail = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/mrp/deliverBatch/detail"),
    data
  });
};
